<?php


/**
 * Notes:
 * PROJECT_NAME : ERP v1.8 重构erp
 * User: 夏鱼儿<397072174@qq.com>
 * Date: 2024/4/26
 * Time: 17:04
 */

namespace app\tms\model;

use app\service\base\Model;

/**
 * @method static user($deliver_driver_id)
 * @method static taskStatus($task_status)
 */
class Base extends Model
{

    /**
     * 用户ID
     * @param $query
     * @param $deliver_driver_id
     * @return mixed
     */
    public function scopeUser($query, $deliver_driver_id): mixed
    {
        return $query->where('deliver_driver_id', $deliver_driver_id);
    }

    /**
     * 任务状态
     * @param $query
     * @param $task_status
     * @return mixed
     */
    public function scopeTaskStatus($query, $task_status): mixed
    {
        if ($task_status) return $query->where('task_status', $task_status);
        return $query;
    }
}